package com.lanqiao.testwork01;

public class Rectangle {
	// 属性
	private double length;
	private double width;
	
	//行为
	public Rectangle(double length,double width) {
		this.length = length;
		this.width = width;
	}
	
	public double getArea() {
		double area = length * width;
		return area;
	}
	
	public double getPer() {
		double per = 2 * (length + width);
		return per;
	}
	
	public void showAll() {
		System.out.println("该矩形长为：" + length + "，宽为："+width);
		System.out.println("面积为：" + getArea());
		System.out.println("周长为：" + getPer());
	}
}
